package com.hhs.storage.controller;


import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.plugins.Page;
import com.hhs.storage.bean.InputParam;
import com.hhs.storage.bean.YymCzLog;
import com.hhs.storage.service.YymCzLogService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author yuanjun
 * @since 2020-08-20
 */
@RestController
@RequestMapping("/do/yymczlog")
@Slf4j
public class YymCzLogController {
    @Resource
    YymCzLogService yymCzLogService;
    @RequestMapping(value = "getAll")
    public Map<String, Object> getAll(InputParam inputParam) throws Exception {
        log.info("查询意见分页信息");
        Page<YymCzLog> result = yymCzLogService.findPage(inputParam);
        Map<String, Object> map = new HashMap<String, Object>();
        map.put("rows", result.getRecords());
        map.put("total",result.getTotal());
        return map;
    }

    @RequestMapping(value = "getTotalCz")
    public Map<String, Object> getTotalCz(InputParam inputParam) throws Exception {
        log.info("查询总充值信息");
        int result = yymCzLogService.zcz(inputParam);
        Map<String, Object> map = new HashMap<String, Object>();
        map.put("total",result);
        return map;
    }

    @RequestMapping(value = "getTadayCz")
    public Map<String, Object> getTadayCz(InputParam inputParam) throws Exception {
        log.info("查询今日总充值信息");
        int result = yymCzLogService.jrzcz(inputParam);
        Map<String, Object> map = new HashMap<String, Object>();
        map.put("total",result);
        return map;
    }
}

